home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
comm
/
comm2
/
hdrbbs11.lh0
/
HBBS
/
Source
/
Test
/
SharedLib
/
READ.ME
< prev
next >
Wrap
Text File
|
1996-06-25
|
2KB
|
65 lines
DEBUGGING SHARED LIBRARIES
--------------------------
To debug a shared library, perform the following steps:
1. Build the library.
Just type "SMAKE" in the Shell or double-click on the "Build" icon.
SMAKE will build the library "mylib.library" and install it in your
LIBS: directory. It will build the test program "test" in the current
directory.
2. Run the test program under the debugger.
From the Shell, type
cpr test
or from Workbench, click on the "Debug" icon, hold down the SHIFT key
and double-click on the "test" icon.
3. Let CPR know you want to debug shared libraries.
Type the following in the dialog window:
opt reslib on
or use the mouse to select the "Step into Reslib?" menu item from the
"Options" menu.
4. Set a breakpoint in the library routine and proceed.
Type the following in the CPR dialog window:
b mylib.library:LIBtest1
go
After typing "go", you should see CPR stop at the routine "test1" in your
library. The LIB preceding the name "test1" may vary depending on how you
specify the LIBPREFIX option. Only functions that are listed in your .fd
file need the prefix.
5. Use the debugger normally.
Anything you can do in the debugger under normal circumstances is legal
in the shared library. Try setting the value of the external variable "b":
set b = 10
go
You should hit your breakpoint again. Go to the workbench by clicking on
the front-to-back gadget in the upper right-hand corner. You'll see that
the function test1 returned 10.
6. Clear all breakpoints and allow the program to complete.
bc *
go
Note that under both AmigaDOS 1.3 and 2.0, there will be a short delay
because the test program calls the Delay() function. Under AmigaDOS 2.0,
you will have to go to the workbench and click on the close gadget of the
program before the program will terminate.